const { DataTypes } = require('sequelize')
const sequelize = require('../config/database')

const CityModel = sequelize.define('City', {
  city_id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    allowNull: false,
    autoIncrement: true
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false
  },
  province_id: {
    type: DataTypes.INTEGER,
    allowNull: false
  },
  is_hot: {
    type: DataTypes.TINYINT,
    allowNull: false,
    defaultValue: 0
  },
  first_key: {
    type: DataTypes.CHAR,
    allowNull: false
  }
}, {
  freezeTableName: true,
  tableName: 'city',
  timestamps: false
})

module.exports = CityModel